/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: ProducerController
 * Author:   pc
 * Date:     2019/9/2 11:20
 * Description: 逻辑控制层
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.example.rabbitmqdemo.controller;


import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.example.rabbitmqdemo.rabbit.TestProducer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * 〈功能：〉<br> 
 * 〈逻辑控制层〉
 * @author liuhaoran
 * @create 2019/9/2 11:20
 * @since 1.0.0
 */
@Component
@RestController
public class ProducerController {
	@Autowired
	private TestProducer testProducer;
	@RequestMapping("/sendMsg")
	public String senddirect() throws JSONException {
		testProducer.send("demo_queue");
		return "success";
	}
}